import httpInstance from "@/utils/http";

//获取banner
export function getBannerAPI(params = {}) {
    // export 是把函数暴露出去，不然外面调用不了
    // 默认为1 商品为2
    const {distributionSite = '1'} = params //有参数则赋值，没有则是默认值1
    return httpInstance({
        url: '/home/banner',
        params:{
          distributionSite
        }
    })
}

// 获取新鲜好物
/**
 * @description: 获取新鲜好物
 * @param {*}
 * @return {*}
 */
export const findNewAPI = () => {
    return httpInstance({
      url:'/system/detail/listFour'
    })
  }

/**
 * @description: 获取人气推荐
 * @param {*}
 * @return {*}
 */
export const getHotAPI = () => {
    return  httpInstance({url:'/system/detail/listFour'})
  }

  /**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
 */
export const getGoodsAPI = () => {
  return httpInstance({
    url: '/home/goods'
  })
}